#ifndef _FONT_MNGR_H
#define _FONT_MNGR_H

#include <stdint.h>
#include <stdbool.h>

//--------------外部flash字库-------------
#if defined(R5MAX_BOARD) || defined(R5_BOARD) || defined(IT_POWER_01_BOARD)
#else
#define FONT_SIZE 24
typedef struct __extern_font_char_info_t
{
    uint8_t width;
    uint8_t height;
    uint8_t data[(FONT_SIZE + 7) / 8 * (FONT_SIZE)];
} extern_font_char_info_t;
void extern_font_get_bit_map(uint16_t unicode, extern_font_char_info_t *char_info);
#endif
#define FONT16_SIZE 16

typedef struct
{
    uint8_t width;
    uint8_t height;
    uint8_t data[(FONT16_SIZE + 7) / 8 * (FONT16_SIZE)];
} extern_font16_char_info_t;

bool extern_font_is_valid(void);
void extern_font16_get_bit_map(uint16_t unicode, extern_font16_char_info_t *char_info);
//---------字库版本-----------
typedef enum
{
    FONT_TYPE_HOME_TIME,
} font_type_t;

// int font_get_width(font_type_t font_type, uint32_t unicode);
// int font_get_height(font_type_t font_type, uint32_t unicode);
// int font_get_data_size(font_type_t font_type, uint32_t unicode);
// int font_get_data(font_type_t font_type, uint32_t unicode, uint8_t out_buf[], int out_size);
void font_chip_init(void);
bool font_chip_check_exist(void);
uint16_t font_chip_get_matrix(uint32_t unicode, uint8_t out_buf[]);

void font_chip_wakeup(void);
void font_chip_deep_sleep(void);

void font_spi_io_uinit(void);
#endif
